<template>
    <div class=""  >
        <div class="container" v-loading="dataListLoading">
            <el-form :inline="true" :model="tableForm" ref="tableForm" class="demo-form-inline" label-position="right" label-width="80px">
                <div>
                    <el-form-item prop="yearly" class="nine-form-title" label="学年">
                        <el-select placeholder="请选择"  v-model="tableForm.yearly" clearable @change="getPermissionArea('areaId')">
                            <el-option  v-for="(item, index) in yearlist" :key="index" :label="item.key" :value="item.value"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item prop="subjectType" class="nine-form-title" label="班级科目">
                        <el-select placeholder="请选择"  v-model="tableForm.subjectType" clearable >
                            <el-option  label="主三科" value="2"></el-option>
                            <el-option  label="主三科+史地政" value="0"></el-option>
                            <el-option  label="主三科+物化生" value="1"></el-option>
                            <el-option  label="主三科+物化生史地政" value="3"></el-option>
                            <el-option  label="物理" value="4"></el-option>
                            <el-option  label="化学" value="5"></el-option>
                            <el-option  label="生物" value="6"></el-option>
                            <el-option  label="历史" value="7"></el-option>
                            <el-option  label="地理" value="8"></el-option>
                            <el-option  label="政治" value="9"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item class="nine-form-title" label="上课校区" prop="areaId">
                        <el-select placeholder="请选择"  v-model="tableForm.areaId" :clearable="queryListAll['areaList'] && queryListAll['areaList'].length!=1" @change="getPermissionArea">
                            <el-option  v-for="item in queryListAll['areaList']" :key="item.id" :label="item.name" :value="item.id"></el-option>
                        </el-select>
                    </el-form-item>
                </div>                
                <div v-if="!isHideRow">
                    <div>
                        <el-form-item  prop="classId" class="nine-form-title" label="班级ID">
                            <el-input  v-enter-number  v-model="tableForm.classId" maxlength="5" clearable></el-input>
                        </el-form-item>
                        <el-form-item prop="className" class="nine-form-title" label="班级名称">
                            <el-input type="text" v-model="tableForm.className" maxlength="50" clearable></el-input>
                        </el-form-item>
                    </div>
                    <div>
                        <el-form-item class="searchbt">
                            <el-button type="primary" @click="exportData">导出</el-button>
                            <el-button @click="submitForm(tableForm)">查询</el-button>
                        </el-form-item>
                        <div class="box-p-pre">
                            <p class="box-p" @click="isHideRow = !isHideRow">
                                <span v-if="!isHideRow">【显示- 更多查询项】</span>
                                <span v-if="isHideRow">【隐藏- 更多查询项】</span>
                            </p>
                        </div>
                    </div>
                    <!-- <i class="el-icon-arrow-down show-list" :class="[{'icon-rotate': isHideRow}]" @click="isHideRow = !isHideRow"></i> -->
                </div>
                <div class="hide-row" v-if="isHideRow">
                    <div>
                        <el-form-item prop="grade" class="nine-form-title" label="年级">
                            <el-select placeholder="请选择"  v-model="tableForm.grade" @change="getPermissionArea('areaId')">
                                <el-option  v-for="item in queryListAll['gradeList']" :key="item.id" :label="item.name" :value="item.id"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item prop="productIds" class="nine-form-title" label="产品线">
                            <el-select placeholder="请选择（可多选）"  v-model="tableForm.productIds" multiple collapse-tags clearable>
                                <el-option  v-for="(item, index) in productList" :key="index" :label="item.key" :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item  prop="paperType" class="nine-form-title" label="试卷类型">
                            <el-select placeholder="请选择"  v-model="tableForm.paperType" clearable>
                                <el-option  label="北京卷" value="0"></el-option>
                                <el-option  label="全国卷" value="1"></el-option>
                            </el-select>
                        </el-form-item>
                    </div>
                    <div>
                        <el-form-item prop="classType" class="nine-form-title" label="班级类型">
                            <el-select placeholder="请选择"  v-model="tableForm.classType" clearable>
                                <el-option  label="行政班" value="0"></el-option>
                                <el-option  label="教学班" value="1"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item  prop="classId" class="nine-form-title" label="班级ID">
                            <el-input  v-enter-number  v-model="tableForm.classId" maxlength="5" clearable></el-input>
                        </el-form-item>
                        <el-form-item prop="className" class="nine-form-title" label="班级名称">
                            <el-input type="text" v-model="tableForm.className" maxlength="50" clearable></el-input>
                        </el-form-item>
                    </div>
                    <div v-if="isHideRow">
                        <el-form-item class="searchbt">
                            <el-button type="primary" @click="exportData">导出</el-button>
                            <el-button @click="submitForm(tableForm)">查询</el-button>
                        </el-form-item>
                        <!-- <i class="el-icon-arrow-down show-list" :class="[{'icon-rotate': isHideRow}]" @click="isHideRow = !isHideRow"></i> -->
                        <div class="box-p-pre">
                            <p class="box-p" @click="isHideRow =! isHideRow">
                                <span v-if="!isHideRow">【显示- 更多查询项】</span>
                                <span v-if="isHideRow">【隐藏- 更多查询项】</span>
                            </p>
                        </div>
                    </div>
                </div>
            </el-form>
            <el-table 
                :data="tableData" 
                border
                highlight-current-row 
                class="table" 
                ref="multipleTable" 
                :header-cell-style="{background: '#f1f1f1', color: '#333'}" >
                <!-- <el-table-column label="序号" align="center" width="50"  hidden="hidden">
                    <template scope="scope"><span>{{scope.$index+(pageNo- 1) * pageSize + 1}} </span></template>
                </el-table-column> -->
                <el-table-column prop="classId" header-align="center" align="center" width="70" label="班级ID"></el-table-column>
                <el-table-column prop="className" header-align="center" align="center" label="班级名称"></el-table-column>
                <el-table-column prop="gradeStr" header-align="center"  align="center" label="年级"> </el-table-column>
                <el-table-column prop="areaName" header-align="center" align="center" label="上课校区"></el-table-column>
                <el-table-column prop="classType" header-align="center" align="center" label="班级类型">
                     <template slot-scope="scope">
                        <el-col v-if="scope.row.classType == 0">行政班</el-col>
                        <el-col v-else>教学班</el-col>
                    </template>
                </el-table-column>
                <el-table-column prop="subjectType" header-align="center" align="center" label="班级科目">
                    <template slot-scope="scope">
                        <el-col v-if="scope.row.subjectType == 0">主三科+史地政</el-col>
                        <el-col v-else-if="scope.row.subjectType == 1">主三科+物化生</el-col>
                        <el-col v-else-if="scope.row.subjectType == 3">主三科+物化生史地政</el-col>
                        <el-col v-else-if="scope.row.subjectType == 2">主三科</el-col>
                        <el-col v-else-if="scope.row.subjectType == 4">物理</el-col>
                        <el-col v-else-if="scope.row.subjectType == 5">化学</el-col>
                        <el-col v-else-if="scope.row.subjectType == 6">生物</el-col>
                        <el-col v-else-if="scope.row.subjectType == 7">历史</el-col>
                        <el-col v-else-if="scope.row.subjectType == 8">地理</el-col>
                        <el-col v-else-if="scope.row.subjectType == 9">政治</el-col>
                        <el-col v-else></el-col>
                    </template>
                </el-table-column>
                <el-table-column prop="realname" header-align="center" align="center" label="班主任"></el-table-column>
                <el-table-column prop="teacherNames" header-align="center" align="center" label="授课教师" max-width="120" show-overflow-tooltip></el-table-column>
                <el-table-column prop="realNum" header-align="center" align="center" label="在班人数"></el-table-column>
                <el-table-column prop="totalNum" header-align="center" align="right" label="名额">
                    <!-- <template slot-scope="scope">
                        <el-col>{{scope.row.realNum +"/" + scope.row.totalNum}}</el-col>
                    </template> -->
                </el-table-column>
                <el-table-column prop="doorPlate" header-align="center" align="center" label="教室"></el-table-column>
                <!-- <el-table-column prop="paperType" header-align="center" align="center" label="卷种">
                    <template slot-scope="scope">
                        <el-col v-if="scope.row.paperType == 0">北京卷</el-col>
                        <el-col v-else>全国卷</el-col>
                    </template>
                </el-table-column> -->
                <el-table-column prop="status" header-align="center" align="center" width="70" label="状态">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.status == 0" size="small" type="danger">禁用</el-tag>
                        <el-tag v-else size="small">正常</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="操作" width="180" header-align="center" align="left">
                    <template slot-scope="scope">
                        <el-button type="text" icon="el-icon-view" @click="viewStudent(scope.$index, scope.row)">学生名单</el-button>
                        <el-button type="text" icon="el-icon-view" @click="viewTeacher(scope.$index, scope.row)">授课教师</el-button>
                     </template>
                </el-table-column>
            </el-table>
            <!-- <el-divider>
                <p><span>总人数：</span><span class="el_div_num" @click="toStuDetails">{{studentNum}}</span><span>平均班额：{{avgNum}}</span></p>
            </el-divider> -->
            <div class="pagination">
                <el-pagination
                    @size-change="sizeChangeHandle"
                    @current-change="currentChangeHandle"
                    :current-page="pageNo"
                    :page-sizes="[10,20,50]"
                    :page-size="pageSize" 
                    :total="totalPage"
                    layout="total, sizes,prev, pager, next, jumper">
                </el-pagination>
            </div>
            <div class="totalN">
                <div>
                    <p>
                        <strong>行政班：</strong>
                        <span class="el_div_num" @click="toStuDetails" v-if="this.studentNum === '' || this.studentNum == null || this.studentNum == undefined"><strong>0</strong></span>
                        <span class="el_div_num" @click="toStuDetails" v-else><strong>{{studentNum}}</strong></span>
                        <strong>平均班额：</strong>
                        <span v-if="this.avgNum === '' || this.avgNum == null || this.avgNum == undefined"><strong>0.00</strong></span>
                        <span v-else><strong>{{avgNum}}</strong></span>
                    </p>
                </div>
                <div>
                    <p>
                        物理班：<span v-if="this.studentNum104 === '' || this.studentNum104 == null || this.studentNum104 == undefined">0</span><span v-else>{{studentNum104}}</span>
                        平均班额：<span v-if="this.avgNum104 === '' || this.avgNum104 == null || this.avgNum104 == undefined">0.00</span><span v-else>{{avgNum104}}</span>
                    </p>
                    <p>
                        化学班：<span v-if="this.studentNum105 === '' || this.studentNum105 == null || this.studentNum105 == undefined">0</span><span v-else>{{studentNum105}}</span>
                        平均班额：<span v-if="this.avgNum105 === '' || this.avgNum105 == null || this.avgNum105 == undefined">0.00</span><span v-else>{{avgNum105}}</span>
                    </p>
                    <p>
                        生物班：<span v-if="this.studentNum106 === '' || this.studentNum106 == null || this.studentNum106 == undefined">0</span><span v-else>{{studentNum106}}</span>
                        平均班额：<span v-if="this.avgNum106 === '' || this.avgNum106 == null || this.avgNum106 == undefined">0.00</span><span v-else>{{avgNum106}}</span>
                    </p>
                </div>
                <div>
                    <p>
                        历史班：<span v-if="this.studentNum107 === '' || this.studentNum107 == null || this.studentNum107 == undefined">0</span><span v-else>{{studentNum107}}</span>
                        平均班额：<span v-if="this.avgNum107 === '' || this.avgNum107 == null || this.avgNum107 == undefined">0.00</span><span v-else>{{avgNum107}}</span>
                    </p>
                    <p>
                        地理班：<span v-if="this.studentNum108 === '' || this.studentNum108 == null || this.studentNum108 == undefined">0</span><span v-else>{{studentNum108}}</span>
                        平均班额：<span v-if="this.avgNum108 === '' || this.avgNum108 == null || this.avgNum108 == undefined">0.00</span><span v-else>{{avgNum108}}</span>
                    </p>
                    <p>
                        政治班：<span v-if="this.studentNum109 === '' || this.studentNum109 == null || this.studentNum109 == undefined">0</span><span v-else>{{studentNum109}}</span>
                        平均班额：<span v-if="this.avgNum109 === '' || this.avgNum109 == null || this.avgNum109 == undefined">0.00</span><span v-else>{{avgNum109}}</span>
                    </p>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import { baseUrl } from '@/utils/api';
function downFile(blob, fileName) {
    if (window.navigator.msSaveOrOpenBlob) {
    navigator.msSaveBlob(blob, fileName);
    } else {
    var link = document.createElement('a');
    link.href = window.URL.createObjectURL(blob);
    link.download = fileName;
    link.click();
    window.URL.revokeObjectURL(link.href);
    }
}
import {mapGetters, mapMutations, mapActions} from 'vuex';
export default {
    name: 'qrzClassView',
    data() {
        return {
            dataListLoading: false,
            tableForm:{
                subjectType:'',
                areaId:'',
                className:'',
                productIds:[],
                yearly: '',
                classId:'',
                paperType:'',
                grade:'',
                classType:''
            },
            pageNo: 1,
            pageSize: 10,
            totalPage: 0,
            tableData: [],
            lookVisible: false,
            yearlist:[],
            productList:[],
            arealist: [],
            rowData:{
                classId:'',
                className:'',
                gradeStr:'',
                grade:'',
                officeName:'',
                areaId:'',
                classType:'',
                subjectType:'',
                masterId:'',
                realname:'',
                yearly:'',
                productIds:'',
                productName:'',
                paperType:'',
                classroomId:'',
                doorPlate:'',
                courseCycId:'',
                courseCycName:'',
                salaryType:'',
                totalNum:''

            },
            studentNum: 0,
            studentNum104: 0,
            studentNum105: 0,
            studentNum106: 0,
            studentNum107: 0,
            studentNum108: 0,
            studentNum109: 0,
            avgNum: 0.00,
            avgNum104: 0.00,
            avgNum105: 0.00,
            avgNum106: 0.00,
            avgNum107: 0.00,
            avgNum108: 0.00,
            avgNum109: 0.00,
            isHideRow: false,
            menuParams: {},//菜单参数
            userInfo: {},
            queryListAll: {//所有查询列表
                areaList: []
            }, 
        }
    },
    created() {
        // this.getOfficeList();
        // this.getYears();
        // this.getProductList()
        // this.getTableData();
        // this.getNowYear();
        this.getSessionSearch(); 
    },
    activated() {
        // isUseCache为false时才重新刷新获取数据
        // 因为对list使用keep-alive来缓存组件，所以默认是会使用缓存数据的         
        if(this.$route.meta.isUseCache == true){
            this.tableData = []; // 清空原有数据
            this.getTableData(); // 这是我们获取数据的函数
        }
        // 通过这个控制刷新
        this.$route.meta.isUseCache = false;
    },
    beforeRouteLeave (to, from, next) { 
        if (to.name == 'viewTeacherList' || to.name == 'showClassStudents' || to.name == 'studentDetails') {
            // 根据是否删除操作，进行判断是否需要使用缓存数据
            to.meta.isUseCache = this.isDel; 
            this.isDel=false;
        }   else {
            to.meta.isUseCache = false; 
        }
        next();  
    },
    methods: {
        ...mapMutations('qrzClassView',['setSearchParams','setShowOtherParam','setRouteParams']),
        getSessionSearch(){
            if(JSON.stringify(this.$route.params)!='{}'){
                this.tableForm = this.$route.params;
            }else{
                let search = JSON.parse(window.sessionStorage.getItem("vuex"))
                if(JSON.stringify(search.qrzClassView.menuParams)!='{}'){
                    this.menuParams = {...this.menuParams, ...search.qrzClassView.menuParams};
                }    
            }
            this.getYears();
            this.getNowYear();
            setTimeout(()=>{
                this.getUserInfo();
            }, 0)
            // this.getTableData();
            this.getProductList();    
        },
        //获取用户信息
        getUserInfo(){
            let _this = this;
            this.$axios.get(baseUrl+'/ft/ftchoose/getUserInfo.do')
                .then(res => {
                    if(res.data.code !==0){
                        _this.$message.error(res.data.msg);
                        return false;
                    }
                    _this.userInfo = res.data || {};
                    _this.getPermissionArea();
            }, err => {
                this.$message.error(err);
            });
        },
        /**
         * 获取所有查询列表数据
         * @functionId 菜单id
         * @roleId 角色id
         */
        getPermissionArea(val){
            let _this = this;
            this.tableForm[val]='';
            this.tableForm['classIds']='';
            let param = new URLSearchParams();
            param.append('yearly', this.tableForm.yearly || '');
            param.append('grade', this.tableForm.grade || '');
            param.append('areaId', this.tableForm.areaId || '');
            param.append('functionId', this.menuParams.id || '');
            param.append('roleId', this.userInfo.roleId || '');
            this.$axios.post(baseUrl+'/ft/ftchoose/getSelectPermissions.do', param)
                .then(res => {
                    if(res.data.code !==0){
                        _this.$message.error(res.data.msg);
                        return false;
                    }
                    _this.$forceUpdate();
                    _this.queryListAll= res.data.data || {};
                    Object.keys(_this.queryListAll).forEach(key=>{
                        _this.queryListAll[key] = (!_this.queryListAll[key] && _this.queryListAll[key]!=0) ? [] : _this.queryListAll[key];
                    })
                    if(_this.queryListAll['gradeList'] && _this.queryListAll['gradeList'].length&& !_this.tableForm.grade){
                        _this.tableForm.grade=_this.queryListAll['gradeList'][0].id;
                        setTimeout(()=>{
                            _this.getPermissionArea();
                        },10)
                    }
                    if(_this.queryListAll['areaList'] && _this.queryListAll['areaList'].length==1 && !_this.tableForm.areaId){
                        _this.tableForm.areaId=_this.queryListAll['areaList'][0].id;
                        _this.tableForm.areaName=_this.queryListAll['areaList'][0].name;
                      /*   setTimeout(()=>{
                            _this.getPermissionArea();
                        },20) */
                    }
            }, err => {
                console.log(err);
            });
        },



        //获取当前学年
        getNowYear(){
            this.$axios.get(baseUrl+'/ft/ftchoose/getNowYearly.do')
                .then(res => {
                    if(res.data.data){
                        this.tableForm.yearly = Number(res.data.data);
                    }
                    
                    this.getTableData();
            }, err => {
                this.$message.error(err);
            });
        },
        // 每页数
        sizeChangeHandle (val) {
            this.pageSize = val
            this.pageNo = 1
            this.getTableData();
        },
        // 当前页
        currentChangeHandle (val) {
            this.pageNo = val;
            this.getTableData();
        }, 
        getTableData(){
            this.dataListLoading = true;
            let param = new URLSearchParams();
            if(this.pageNo != null && this.pageNo != undefined){
                param.append("pageNo", this.pageNo);
            }
            if(this.pageSize != null && this.pageSize != undefined){
                param.append("pageSize",this.pageSize);
            }
            if(this.tableForm.subjectType != null && this.tableForm.subjectType != undefined){
                param.append("subjectType", this.tableForm.subjectType);// 班级科目
            }
            if(this.tableForm.areaId != null && this.tableForm.areaId != undefined){
                param.append("areaId", this.tableForm.areaId);// 授课地点
            }
            if(this.tableForm.className != null && this.tableForm.className != undefined){
                param.append("className", this.tableForm.className);// 班级名称
            }
            if(this.tableForm.classId != null && this.tableForm.classId != undefined){
                param.append("classId", this.tableForm.classId);// 班级id
            }
            if(this.tableForm.yearly != null && this.tableForm.yearly != undefined){
                param.append("yearly", this.tableForm.yearly);// 学年
            }
            if(this.tableForm.productIds.length > 0){
                param.append("productIds", this.tableForm.productIds.join(','));// 产品线
            } else {
                param.append("productIds", '');// 产品线
            }
            if(this.tableForm.paperType != null && this.tableForm.paperType != undefined){
                    param.append("paperType", this.tableForm.paperType);// 试卷种类（0、北京卷 1、全国卷）
            }
            if(this.tableForm.grade != null && this.tableForm.grade != undefined){
                param.append("grade", this.tableForm.grade);// 年级
            }
            if(this.tableForm.classType != null && this.tableForm.classType != undefined){
                param.append("classType", this.tableForm.classType);// 班级类型 （0行政班 1教学班）
            }
            let classIds = [];
            if(this.queryListAll['masterOrTeacherList'] && this.queryListAll['masterOrTeacherList'].length){//默认传全部
                this.queryListAll['masterOrTeacherList'].forEach(item=>{
                    classIds.push(item.id);
                })
            }
            param.append('classIds', classIds.join(','));
            this.$axios.post(baseUrl+'/ft/classmanage/getClassList.do',param).then(res => {
                if(res.data!=null&&res.data.code==0){
                    let data = res.data.data;
                    this.totalPage = data.totalSize;
                    this.tableData = data.items;
                    this.studentNum = data.studentNum;
                    this.studentNum104 = data.studentNum104;
                    this.studentNum105 = data.studentNum105;
                    this.studentNum106 = data.studentNum106;
                    this.studentNum107 = data.studentNum107;
                    this.studentNum108 = data.studentNum108;
                    this.studentNum109 = data.studentNum109;
                    this.avgNum = data.avgNum;
                    this.avgNum104 = data.avgNum104;
                    this.avgNum105 = data.avgNum105;
                    this.avgNum106 = data.avgNum106;
                    this.avgNum107 = data.avgNum107;
                    this.avgNum108 = data.avgNum108;
                    this.avgNum109 = data.avgNum109;
                }else{
                    this.tableData = [];
                    this.totalPage = 0;
                }
                this.dataListLoading = false;
            }, err => {
                this.$message.error(err);
            });
        },
        getYears(){
            //获取学年
            this.$axios.post(baseUrl+'/ft/campus/getSchoolYearList.do')
                .then(res => {
                    if(res.data!=null&&res.data.code==0){
                        //获取菜单列表
                    this.yearlist = res.data.data;
                    }else{
                    this.yearlist = [];
                    }
                this.dataListLoading = false;
                    
            }, err => {
                this.$message.error(err);
            });
        },
        getProductList(){
        //获取产品线列表
            let param = new URLSearchParams();
            this.$axios.post(baseUrl+'/ft/campus/getProductList.do')
                .then(res => {
                    if(res.data!=null&&res.data.code==0){
                        //获取菜单列表
                        this.productList = res.data.data;
                    }else{
                        this.productList = [];
                    }
                this.dataListLoading = false;
            }, err => {
                this.$message.error(err);
            });
        },
        getOfficeList(){
            //上课校区
            this.$axios.post(baseUrl+'/ft/ftchoose/getQrzAreas.do')
                .then(res => {
                    if(res.data){
                        //获取菜单列表
                        this.arealist = res.data;
                    }
            }, err => {
                console.log(err);
            });
        },
        submitForm(tableForm) {
            this.dataListLoading = true;
            this.pageNo = 1
            this.getTableData();
        },
        toAdd(){
            this.$router.push('/addqrzclass')
        },
        viewTeacher(index,row){
            this.isDel=true;
            let params = {
                classId: row.classId,
                className: row.className
            } 
            this.$store.commit('viewTeacherList/setRouteParams', params) 
            this.$router.push({
                name: 'viewTeacherList', 
                path: '/viewTeacherList', 
                params: params
            })
                
        },
        viewStudent(index,row){
            this.isDel=true;
            let params = {
                id: row.classId,
                name: row.className,
                radio: row.status,
                flag: 2,//班主任班级管理-学生名单跳转时会带flag参数，flag=0；教师班级管理--flag为3；高考全日制班级管理 flag = 4;高考全日制班级查看 flag = 2
                grade:row.grade,
                paperType:row.paperType,
                classType: row.classType,
            } 
            this.$store.commit('showClassStudents/setRouteParams', params);
            this.$router.push({
                name: 'showClassStudents',
                path: '/showClassStudents',
                // name: 'viewStudentList', 
                // path: '/viewStudentList', 
                params :params
            }) 
        },
        /**
         * 导出
         */
        exportData(){
            this.dataListLoading=true;
            let exportObj ={responseType: 'blob'};
            let param = new URLSearchParams();
            param.append("yearly", this.tableForm.yearly || '');// 学年
            param.append("subjectType", this.tableForm.subjectType || '');// 班级科目
            param.append("areaId", this.tableForm.areaId || '');// 上课校区
            param.append("grade", this.tableForm.grade || '');// 年级
            if(this.tableForm.productIds.length > 0){
                param.append("productIds", this.tableForm.productIds.join(','));// 产品线
            } else {
                param.append("productIds", '');
            }
            param.append("paperType", this.tableForm.paperType || '');// 试卷种类（0、北京卷 1、全国卷）
            param.append("classType", this.tableForm.classType || '');// 班级类型 （0行政班 1教学班）
            param.append("classId", this.tableForm.classId || '');// 班级id
            param.append("className", this.tableForm.className || '');// 班级名称
            let classIds = [];
            if(this.queryListAll['masterOrTeacherList'] && this.queryListAll['masterOrTeacherList'].length){//默认传全部
                this.queryListAll['masterOrTeacherList'].forEach(item=>{
                    classIds.push(item.id);
                })
            }
            param.append('classIds', classIds.join(','));
            this.$axios.post(baseUrl + '/ft/classmanage/downloadClassList.do', param, exportObj)
            .then(res=>{
                let headerContent = res.headers['content-disposition'];   
                if(headerContent){
                    let filenameStr = headerContent.split('=')[1];
                    let blobobj = new Blob([res.data],{type:'application/vnd.ms-excel'});
                    downFile(blobobj, decodeURI(filenameStr));
                }
                this.dataListLoading = false;
            })
        },
        /**
         * 学生详情
         */
        toStuDetails(){
            this.isDel = true;
            let params = {type: 1, ...this.tableForm}
            this.$store.commit('studentDetails/setRouteParams', params);
            this.$router.push({
                name: 'studentDetails',
                path: '/studentDetails',
                params : params
            })
        }
    }
}

</script>

<style scoped>
    .icon-rotate{
        transform: rotate(180deg);
    }
    .el-icon-arrow-down.show-list{
        cursor: pointer;
        line-height: 32px;
        margin-left: 10px;
    }
    .handle-box {
        margin-bottom: 20px;
    }

    .handle-select {
        width: 120px;
    }

    .handle-input {
        width: 300px;
        display: inline-block;
    }
    .del-dialog-cnt{
        font-size: 16px;
        text-align: center
    }
    .table{
        width: 100%;
        font-size: 14px;
    }
    .red{
        color: #ff0000;
    }
    .mr10{
        margin-right: 10px;
    }
    .searchbt{
        text-align: center;
        /* margin-bottom: 10px; */
        margin-left: 20px;
    }
    .box-p-pre{
        display: inline-block;
        vertical-align: bottom;
        line-height: 40px;
    }
    .box-p{
        display: inline-block;
        font-size: 12px;
        margin-right: 10px;
        cursor: pointer;
        color: #409EFF;
        vertical-align: bottom;
    }
    .totalN{
        border: 1px solid #EBEEF5;
        padding: 15px 4%;
        font-size: 13px;
    }
    .totalN div{
        width: 100%;
        display: flex;
        padding: 6px 0;
    }
    .totalN p{
        flex: 1;
    }
    .totalN p span{
        display: inline-block;
        width: 80px;
    }
    .el_div_num{
        color: #409EFF;
        cursor: pointer;
        /* margin-right: 40px; */
    }
</style>
<style>
    .el-table td {
        padding: 0 0;
    }
</style>